package com.lagou.email.controller;

import com.lagou.email.service.IEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * created by kirito at 2020/7/12
 */
@RestController
@RequestMapping("/api")
public class EmailController {

    @Autowired
    private IEmailService emailService;

    @PostMapping("/email/{email}/{code}")
    public boolean sendAuthCode(@PathVariable(value = "email") String email,
                                @PathVariable(value = "code") String code){

        return emailService.sendAuthCode(email,code);

    }

}
